<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2018/2/14
 * Time: 上午10:26
 */
$arr = [ 1, 2, 3, 4, 5, 6 ];
$i   = array_push( $arr, 7 );
print_r( $arr );
echo $i . PHP_EOL;//7

$i = array_push( $arr, 8, 9, 0 );
print_r( $arr );
echo $i . PHP_EOL;//10

$start = microtime( true );
for ( $x = 1; $x <= 1000000; $x ++ ) {
	$array[] = $x;
}
$end = microtime( true );
echo ( $end - $start ) . PHP_EOL;//0.085584878921509

$start = microtime( true );
for ( $x = 1; $x <= 1000000; $x ++ ) {
	array_push( $array, $x );
}
$end = microtime( true );
echo ( $end - $start ) . PHP_EOL; //0.18144297599792

